<div class="form">

    <?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'post-form',
        'enableAjaxValidation'=>false,
       // 'action'=>'khoa',
        'htmlOptions'=>array('enctype'=>'multipart/form-data'),
        )); ?>

    <p class="note">
    <?php
     echo Yii::t('Site','FIELDS WITH {star} ARE REQUIRED',array('star'=>"<span class='required'>*</span>"));
?>
    
    </p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'title'); ?>
        <?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
        <?php echo $form->error($model,'title'); ?>
    </div>  

    <div class="row">
        <?php echo $form->labelEx($model,'alias'); ?>
        <?php echo $form->textField($model,'alias',array('size'=>60,'maxlength'=>255)); ?>
        <?php echo $form->error($model,'alias'); ?>
    </div>  

    <div class="row">
        <?php echo $form->labelEx($model,'content'); ?>
        <?php //echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?>


        <?php 
            $this->widget('application.extensions.tinymce.ETinyMce', array(
            'model'=>$model,
            'attribute'=>'content',
            'editorTemplate'=>'full',
            'htmlOptions'=>array('style'=>'width: 300px; height: 150px;',
            'external_image_list_url'=>'myexternallist.js')
            ));

        ?>  
        <?php echo $form->error($model,'content'); ?>     
    </div>      
    <div class="row">
        <?php echo $form->labelEx($model,'tags'); ?>
        <?php echo $form->textField($model,'tags',array('size'=>60,'maxlength'=>255)); ?>
        <?php echo $form->error($model,'tags'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'create_time'); ?>
        <?php
            $model->create_time=   date('Y-m-d', strtotime($model->create_time) );
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model'=>$model, 
            'attribute'=>'create_time',
            //'id'=>'create_time',
            //'name'=>'create_time', 
            //'value'=>date('m/d/Y',$model->create_time), 

            // additional javascript options for the date picker plugin
            'options'=>array(
            'showAnim'=>'fold',
            'dateFormat' => 'yy-mm-dd', 
            
            ),
            'htmlOptions'=>array(
            'style'=>'height:16px;'
            ),
            ));

        ?>    
        <?php echo $form->error($model,'create_time'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'status'); ?>
        <?php //echo $form->textField($model,'status'); ?>
        <?php //echo $form->dropDownList($model,'status',Lookup::items('PostStatus')); ?>      
        <?php echo $form->dropDownList($model,'status',$model->getStatusOptions(0)); ?>      
        <?php echo $form->error($model,'status'); ?>

    </div>	
    <div class="row">
        <?php echo $form->labelEx($model,'image'); ?>
        <?php
            //var_dump($model->image) ;die();
            //$this->widget('ext.farbtastic.Farbtastic', array('model'=>$model, 'attribute'=>'image'));
            $this->widget('ext.fupload.Fupload', array('model'=>$model,'attribute'=>'image'));
            //echo $form-> fileField($model,'image');
        ?>      
         <?php echo $form->error($model,'image'); ?>        
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->